using Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets;
using Microsoft.AspNetCore.Connections;
using JsonRpcService.Contract;

namespace TcpSample.Server;

public class Program
{
    public static void Main(string[] args)
    {
        CreateHostBuilder(args).Build().Run();
    }

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args).ConfigureServices((hostContext, services) =>
        {
            services.AddScoped<IGreeterService, GreeterService>();
            services.AddHostedService<JsonRpcService>();
            services.AddSingleton<IConnectionListenerFactory, SocketTransportFactory>();
        });
}
